Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding in General Database Executor and Code Exporting #374

Merged
merged 26 commits into from
May 6, 2021

Conversation

thyneb19
Copy link
Contributor

@thyneb19 thyneb19 commented May 6, 2021

Overview

Merging in code changes that add a more generalized Database Executor and code exporting to Lux.

Changes

The Generalized Database Executor works similarly to the SQLExecutor, but rather than having Postgres queries hard coded into the executor itself, these queries are read from a template file. The GeneralDatabaseExecutor then uses this template to access the queries it requires, allowing users to use queries for database systems other than Postgres. An example file for MySQL has been included with these code changes.

thyneb19 and others added 26 commits April 17, 2021 11:39
Co-authored-by: 19thyneb <thyne.boonmark@gmail.com>
Co-authored-by: Doris Lee <dorisjunglinlee@gmail.com>
Co-authored-by: NiStannum <52202164+NiStannum@users.noreply.github.com>
…org#336)

Co-authored-by: Caitlyn Chen <caitlynachen@berkeley.edu>
Co-authored-by: Doris Lee <dorisjunglinlee@gmail.com>
* added notebook gallery
* update README
* removed scatterplot message in SQLExecutor
* fixed typo in SQL documentation
The LuxTracer can be used to keep track of executed code. It is currently being used in the executors to track which lines of code were used to generate individual charts' data.
This executor uses SQL query templates from a specified query file. Rather than having hard coded queries written in the executor itself, this executor leaves the query writing to users.

Currently works with Postgresql.
Added the _trace_code and _query parameters to Lux Vis objects. The _trace_code parameter will store the code used to execute the Vis data, and the _query parameter will store the SQL query used to first aggregate the data for the Vis in the SQLExecutor case.
Lux now only traces the code when a user calls the to_code() function of a Vis object. It does so by starting the tracer and re-executing the Vis object.
Cleaned up handling of for loops in the tracing processor.
Vis objects' _source parameter is now set within the execution function.
Updated the compare_vis() function to use .equals to compare the source dataframes.
Fixed bug where found_variable could be an empty list and was not set to "df"
Added functionality with scatter and bar charts. The query template file for compatibility with MYSQL is also included
Updated to work with the MySQL case, need to change how the executor uses quotations around different Database queries.

Updated the MySQL query template
Needed to update Executor files' code format to remove wrapped lines of code.

Fixed code formatting for the Pandas executor visualizations.
Changed the line formatting to fit the Lux Tracing use case
Removed unnecessary commented lines
Added in variable names to the templates to make it clearer what the inputs need to be
When a SQL connection is made to the Lux config, now defaults to using the Postgres SQLExecutor rather than the GeneralDatabaseExecutor
@thyneb19 thyneb19 merged commit 18c968e into lux-org:sql-engine May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants